<?php
if(empty($dataProvider->data[0]->producer->page_title))
	$this->pageTitle=Yii::app()->name . ' - Каталог - Диски - '.CHtml::encode($dataProvider->data[0]->disk->producer->title).' - '.CHtml::encode($dataProvider->data[0]->disk->title);
else
	$this->pageTitle = $dataProvider->data[0]->disk->page_title;
	
Yii::app()->clientScript->registerMetaTag($dataProvider->data[0]->disk->page_description, 'description');
Yii::app()->clientScript->registerMetaTag($dataProvider->data[0]->disk->page_keywords, 'keywords');

$this->breadcrumbs=array(
	'Шины'=>array('catalog/disks'),
	$dataProvider->data[0]->disk->producer->title => array('catalog/disks', 'aliasProducer'=>$dataProvider->data[0]->disk->producer->alias),
	$dataProvider->data[0]->disk->title,
);
?>

<div class='grid_12 alpha catalog-card'>

	<p class='line'>
	<?php 
	$this->widget('zii.widgets.CBreadcrumbs', array(
		'links'=>$this->breadcrumbs,
		'separator'=>' <span>/</span> ',
		'htmlOptions'=>array('class'=>'left', 'id'=>'breadcrumbs'),
		'homeLink'=>false,
		'tagName'=>'span',
		'encodeLabel'=>false,
	));
	?>
	</p>

	<div class='grid_2 alpha'>
		<?php 
		$small = Image::getFile($dataProvider->data[0]->disk->photo, 'small');
		$small = CHtml::image($small, 'Диск '.CHtml::encode($dataProvider->data[0]->disk->producer->title.' '.$dataProvider->data[0]->disk->title));
		if($big = Image::getFile($dataProvider->data[0]->disk->photo, 'big'))
			echo CHtml::link( $small, $big, array('class'=>'fancybox', 'title'=>'Диск '.CHtml::encode($dataProvider->data[0]->disk->producer->title.' '.$dataProvider->data[0]->disk->title)) );
		else
			echo $small;
		?>
	</div>
	<div class='grid_10 omega item'>
		<h3><?php echo CHtml::encode($dataProvider->data[0]->disk->producer->title.' '.$dataProvider->data[0]->disk->title); ?></h3>
		<?php 
		$sizes = $this->widget('zii.widgets.grid.CGridView', array(
			'dataProvider'=>$dataProvider,
			#'cssFile' => false,
			'summaryText'=>false,
			'ajaxUpdate'=>false,
			'enableSorting'=>false,
			#'enablePagination'=>false,
			'columns' => array(
				array(
					'name'=>'size',
					'type'=>'raw',
					'value'=>'CHtml::link($data->size, array("catalog/disks", "aliasProducer"=>$data->disk->producer->alias, "aliasModel"=>$data->disk->alias, "aliasSize"=>$data->alias), array("title"=>$data->disk->producer->title." ".$data->disk->title." ".$data->size))',
				),
				array(
					'name'=>'rest',
					'value'=>'$data->rest>=4?"Больше 4":"Уточняйте у менеджера"',
					'cssClassExpression'=>'$data->rest>=4?"lot":"few"',
				),

				array(
					'name'=>'price',
					'type'=>'html',
					'value'=>'$data->price>0?number_format($data->price, 2, ",", " ")." <i class=\"rub\">Р</i>":"*"',
				),
				array(
					'name' => '',
					'type'=>'raw',
					'value' => 'Yii::app()->controller->widget("widgets.shopping.buy", array( "model"=>$data ), true)',
				)
			)
		), true);
		$description = '<div class=\'description\'>'.$dataProvider->data[0]->disk->description_marked.'</div>';
		$comments = $this->widget('widgets.comments.comments', array(
			'model'=>$model,
		), true);
		
		$this->widget('zii.widgets.jui.CJuiTabs', array(
		    'tabs'=>array(
		        'Цены и наличие'=>$sizes,
		        'Описание диска'=>$description,
				'Отзывы'=>$comments,
		    ),
		    // additional javascript options for the tabs plugin
		    'options'=>array(
		        'collapsible'=>true,
		    ),
		));
		
		?>
		
		

	</div>
	
	<hr class='space clear' />
</div>

<div class='clear'></div>

<div class='grid_12 alpha'>
	<?php $this->widget('widgets.new.WNewDisks'); ?>
</div>
<div class='clear'></div>
